pub mod encrypted;

pub mod client;
pub mod module;

pub use encrypted::yb_encryptor;
pub use client::login::Client;
pub use client::api;
pub use serde_json::json;

/*#[no_mangle]
pub unsafe extern fn login_yiban(username: *[u8], password: * [u8]) {
    let rt = tokio::runtime::Runtime::new().unwrap();
    rt.block_on(async move {
        let client: Client = login(std::str::from_utf8(&*username).unwrap(),
                                   std::str::from_utf8(&*password).unwrap()).await.unwrap();
        let c = client.get_cookie().to_form_string(
            &[], "=", ";", "",
        );

    });
    rt.shutdown_timeout(Duration::from_micros(10_000))
}*/

#[cfg(test)]
mod test {
    use crate::Client;

    #[tokio::test]
    async fn login_test() {
        let client = Client::new("***", "***");
    }
}